import Layout from '@/layout'
export const voucherRouter = {
  path: '/voucher',
  component: Layout,
  name: 'Voucher',
  alwaysShow: true,
  meta: {
    type: 'G',
    title: '凭证',
    roles: ['3410', '3420', '3430'],
    icon: 'voucher'
  },
  children: [{
    path: 'add',
    component: resolve => require(['@/views/voucher/add'], resolve),
    name: 'VoucherAdd',
    meta: {
      type: 'G',
      title: '新增凭证',
      roles: ['3410', '341010', '341020']
    }
  }, {
    path: 'data',
    component: resolve => require(['@/views/voucher/data'], resolve),
    name: 'VoucherData',
    meta: {
      type: 'G',
      title: '查询凭证',
      roles: ['3420', '342010', '342020', '342030', '342040', '342060', '342070', '342080']
    }
  }, {
    path: 'modify',
    component: resolve => require(['@/views/voucher/add'], resolve),
    name: 'VoucherModify',
    hidden: true,
    meta: {
      type: 'G',
      title: '修改凭证',
      roles: ['342030']
    }
  }, {
    path: 'detail',
    component: resolve => require(['@/views/voucher/add'], resolve),
    name: 'VoucherDetail',
    hidden: true,
    meta: {
      type: 'G',
      title: '查看凭证',
      roles: ['342010']
    }
  }, {
    path: 'insert',
    component: resolve => require(['@/views/voucher/add'], resolve),
    name: 'VoucherInsert',
    hidden: true,
    meta: {
      type: 'G',
      title: '插入凭证',
      roles: ['342020']
    }
  }, {
    path: 'audit',
    component: resolve => require(['@/views/voucher/audit'], resolve),
    name: 'VoucherAudit',
    meta: {
      type: 'G',
      title: '审核凭证',
      roles: ['3430', '343010', '343020', '343030', '343040']
    }
  }, {
    path: 'table',
    component: resolve => require(['@/views/voucher/table'], resolve),
    name: 'VoucherTable',
    meta: {
      type: 'G',
      title: '凭证汇总表',
      roles: ['3440', '344010', '344020', '344030']
    }
  }, {
    path: 'create',
    component: resolve => require(['@/views/voucher/create'], resolve),
    name: 'Create',
    meta: {
      type: 'G',
      title: '生成凭证',
      roles: ['3460', '346010', '346020']
    }
  }]
}

export const accbookRouter = {
  path: '/accbook',
  component: Layout,
  name: 'Accbook',
  alwaysShow: true,
  meta: {
    type: 'G',
    title: '账簿',
    roles: ['36', '3610', '3620'],
    icon: 'chart'
  },
  children: [{
    path: 'ledger',
    component: resolve => require(['@/views/accbook/ledger'], resolve),
    name: 'Ledger',
    meta: {
      type: 'G',
      title: '总账',
      roles: ['3610', '361010', '361020']
    }
  }, {
    path: 'subsidiary',
    component: resolve => require(['@/views/accbook/subsidiary'], resolve),
    name: 'Subsidiary',
    meta: {
      type: 'G',
      title: '明细账',
      roles: ['3620', '362010', '362020']
    }
  }, {
    path: 'coabalance',
    component: resolve => require(['@/views/accbook/coabalance'], resolve),
    name: 'CoaBalance',
    meta: {
      type: 'G',
      title: '科目余额表',
      roles: ['3630', '363010', '363020']
    }
  }, {
    path: 'multisubsidiary',
    component: resolve => require(['@/views/accbook/multisubsidiary'], resolve),
    name: 'Multisubsidiary',
    meta: {
      type: 'G',
      title: '多栏账',
      roles: ['3640', '364010', '364020']
    }
  }, {
    path: 'ledgernum',
    component: resolve => require(['@/views/accbook/ledgernum'], resolve),
    name: 'Ledgernum',
    meta: {
      type: 'G',
      title: '数量总账',
      roles: ['3650', '365010', '365020']
    }
  }, {
    path: 'subsidiarynum',
    component: resolve => require(['@/views/accbook/subsidiarynum'], resolve),
    name: 'Subsidiarynum',
    meta: {
      type: 'G',
      title: '数量明细账',
      roles: ['3660', '366010', '366020']
    }
  }, {
    path: 'projbalance',
    component: resolve => require(['@/views/accbook/projbalance'], resolve),
    name: 'Projbalance',
    meta: {
      type: 'G',
      title: '辅助核算余额表',
      roles: ['3670', '367010', '367020']
    }
  }, {
    path: 'projsubsidiary',
    component: resolve => require(['@/views/accbook/projsubsidiary'], resolve),
    name: 'Projsubsidiary',
    meta: {
      type: 'G',
      title: '辅助核算明细账',
      roles: ['3680', '368010', '368020']
    }
  }]
}

export const reportRouter = {
  path: '/report',
  component: Layout,
  name: 'Report',
  alwaysShow: true,
  meta: {
    type: 'G',
    roles: ['3810', '3820', '3830'],
    title: '报表',
    icon: 'report'
  },
  children: [{
    path: 'debt',
    component: resolve => require(['@/views/report/debt'], resolve),
    name: 'ReportDebt',
    meta: {
      type: 'G',
      roles: ['3810', '381030', '381040'],
      title: '资产负债表'
    }
  }, {
    path: 'profit',
    component: resolve => require(['@/views/report/profit'], resolve),
    name: 'ReportProfit',
    meta: {
      type: 'G',
      roles: ['3820', '382030', '382040'],
      title: '利润表'
    }
  }, {
    path: 'flow',
    component: resolve => require(['@/views/report/flow'], resolve),
    name: 'ReportFlow',
    meta: {
      type: 'G',
      roles: ['3830', '383010', '383020', '383030', '383040'],
      title: '现金流量表'
    }
  }, {
    path: 'subsidiary',
    component: resolve => require(['@/views/report/subsidiary'], resolve),
    name: 'FlowSubsidiary',
    hidden: true,
    meta: {
      type: 'G',
      roles: ['383010', '38301010'],
      title: '联查明细表'
    }
  }, {
    path: 'flowstart',
    component: resolve => require(['@/views/report/flowstart'], resolve),
    name: 'ReportFlowstart',
    hidden: true,
    meta: {
      type: 'G',
      roles: ['383020', '38302010'],
      title: '现金流量期初'
    }
  }]
}

export const periodRouter = {
  path: '/closeperiod',
  component: Layout,
  name: 'closeperiod',
  meta: {
    type: 'G',
    roles: ['4010', '4020'],
    title: '结账',
    icon: 'people'
  },
  children: [{
    path: '/closeperiod',
    component: resolve => require(['@/views/account/closeperiod'], resolve),
    name: 'Closeperiod',
    meta: {
      type: 'G',
      title: '结账',
      roles: ['4020', '402010', '402020', '402030', '402040'],
      icon: 'calclate'
    }
  }]
}
